<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8"> 
    <title>编辑</title>
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">   
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="<%=basePath%>js/bootstrap-3.3.7-dist/css/bootstrap.min.css">
	<link rel="stylesheet" href="<%=basePath%>js/confirm/jquery-confirm.min.css"></script>
	<link rel="stylesheet" href="<%=basePath%>css/init.css">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
	 <div class="col-md-8 col-sm-offset-2 text-center">
	 	<%@include file="/WEB-INF/jsp/public/token.jsp" %>
	  	<form class="navbar-form navbar-center" role="search" id="searchForm" method="post" action="<%=basePath%>sign/signEdit">
		  <input type="hidden" class="form-control" id="eId" name="eId" value="${eId}" placeholder="姓名">
		  <div class="form-group">
		  	<input type="text" class="Wdate form-control" onClick="WdatePicker()" id="signDate" name="signDate" value="${signDate}" style="height:31px;" placeholder="日期"/>
		  </div>
		  <button type="button" id="searchBtn" class="btn btn-default">搜索</button>
		   <button type="button" id="clearBtn" class="btn btn-default">清空</button>
		</form>
	</div>
	<div class="text-center init-login">
		 <a href="<%=basePath%>sign/editList" class="btn btn-primary" role="button"><span class="glyphicon glyphicon-home" aria-hidden="true">返回编辑</a>
	</div>
</nav>
<div class="container">
	<div class="container-fluid">
		<div class="table-responsive">
		<h4>编号:${sign.jobNumber}&nbsp;&nbsp;&nbsp;姓名:${sign.name}</h4>
		<table class="table table-hover">
		  <thead>
		      <tr>
		      	 <th>序号</th>
		         <th>项目</th>
		         <th>上班</th>
		         <th>下班</th>
		         <th>操作</th>
		      </tr>
		   </thead>
		    <tbody>
		   </tbody>
		</table>
		</div>
	</div>
</div>
<script src="<%=basePath%>js/jquery-2.1.1/jquery.min.js"></script>
<script src="<%=basePath%>js/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script>
<script src="<%=basePath%>js/confirm/jquery-confirm.min.js"></script>
<script src="<%=basePath%>js/common.js"></script>
<script src="<%=basePath%>js/web/sgin/edit/editList/metaData.js"></script>
<script type="text/javascript">
var jsonDataeee='${dataJson1}';
var selectData='${selectJson}';
MetaData.init('sginList',jsonDataeee,'.table tbody',selectData,1);
function alertWin(content){
	$.alert({
	    title: '提示框',
	    content: content,
	    confirm: function(){
	       
	    }
	});
 }
$(function(){
	$("#searchBtn").click(function(){
		$('#searchForm').submit();
	});
	$("#clearBtn").click(function(){
		$('#jobNumber').val("");
		$('#name').val("");
	});
	 $("#updateBtn").click(function(){
			$.ajax({
				url:"updateSignLog",
				data:$("edieForm").serialize(),
				async:false,
				dataType:"json",
				type:"post",
				success:function(data){
					if(data.status=='success'){
						alertWin("更新成功");
					}else{
						alertWin("更新成功");
					}
				}
			});
		 });
	 var pageindex = 1;
	//滚动加载数据监听
	 $(window).scroll(function () {
	       var scrollTop = $(this).scrollTop();
	       var scrollHeight = $(document).height();
	       var windowHeight = $(this).height();
	       if (scrollTop + windowHeight == scrollHeight) {
	    	   pageindex++;
	    	   MetaData.init('sginList',jsonDataeee,'.table tbody',selectData,pageindex);
	       }
	 });
});
//签到时间删除方法
function editSignLogDel(eId){
	if(confirm("确认是否删除？")==true){
		var url="<%=basePath%>/sign/editSignLogDel?eId="+eId;
		$.ajax({
			url :url,
			type:"post",
			dataType: 'json',
			success : function(ajaxdata) {
				if(ajaxdata.code=="2000"){
					alert("删除成功");
					$('#searchForm').submit();
				}else if(ajaxdata.code=="4000"){
					alert("删除失败");
				}
			}
		});
	}
}
</script>
</body>
</html>
